<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GrowingTree</title>
<link rel="stylesheet" type="text/css"
	href="all/lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="all/stylesheets/theme.css">
<link rel="stylesheet" href="all/lib/font-awesome/css/font-awesome.css">
<script src="all/lib/jquery-1.7.2.min.js" type="all/text/javascript">
</script>
<style type="text/css">
#line-chart {
	height: 300px;
	width: 800px;
	margin: 0px auto;
	margin-top: 1em;
}

.brand {
	font-family: georgia, serif;
}

.brand .first {
	color: #ccc;
	font-style: italic;
}

.brand .second {
	color: #fff;
	font-weight: bold;
}
</style>
<link rel="shortcut icon" href="../assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="../assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="../assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="../assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<%
    String userId = "";
	String adminName = "";
	String adminPass = "";
	Cookie[] cookie = request.getCookies();
	if (cookie != null) {
		for (int i = 0; i < cookie.length; i++) {
			Cookie tem = cookie[i];
			if (tem.getName().equals("userId")) {
				userId = cookie[i].getValue();
			}
			if (tem.getName().equals("adminName")) {
				adminName = cookie[i].getValue();
			}
			if (tem.getName().equals("adminPass")) {
				adminPass = cookie[i].getValue();
			}
		}
	}
%>
<body>
	<script type="text/javascript">
		function checkValidate() {
		//判断用户ID不能为空
		if (document.form1.userId.value == "") {
				window.alert("用户ID不能为空！！！");
				return false;
			}
			//判断用户名是否为空 
			if (document.form1.adminName.value == "") {
				window.alert("用户名不能为空！！！");
				return false;
			}
			//判断密码是否为空 
			if (document.form1.adminPass.value == "") {
				window.alert("密码不能为空！！！");
				return false;
			}
	
		}
	</script>
	<div class="navbar">
		<div class="navbar-inner">
			<a class="brand" href="index.jsp"><span class="first">Growing</span>
				<span class="second">Tree</span></a>
		</div>
	</div>
	<div class="row-fluid">
		<div class="dialog">
			<div class="block" style="height: 351px; ">
				<p class="block-heading">登录</p>
				<div class="block-body">
					<form action="login" method="post" name="form1">
					    <label>管理员ID</label> <input type="text" class="span12"
							name="userId" value="<%=request.getAttribute("userId") %>">
						<label>用户名</label> <input type="text" class="span12"
							name="adminName" value=""> <label>密
							码</label> <input type="password" class="span12" name="adminPass"
							value=""> <input type="submit"
							onClick="return checkValidate();" class="span13" value="登录"
							class="btn btn-primary pull-right" style="width: 83px; ">
						<label class="remember-me"><input type="checkbox">
							记住密码</label>
						<div class="clearfix"></div>
					</form>
				</div>
			</div>
			<p class="pull-right" style=""></p>
			
				<a href="reset-password.jsp">忘记密码?</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
			<a href="register.jsp">注册</a>
		</div>
	</div>
	<script src="all/lib/bootstrap/js/bootstrap.js"></script>
	<script type="text/javascript">
		$("[rel=tooltip]").tooltip();
		$(function() {
			$('.demo-cancel-click').click(function() {
				return false;
			});
		});
	</script>
</body>
</html>


